{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Highcharts Demos\n",
    "=================\n",
    "Multiple axes: http://www.highcharts.com/demo/combo-multi-axes\n",
    "---------------------------------------------------------------"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<iframe style=\"border:0;outline:none;overflow:hidden\" srcdoc=\"&lt;!DOCTYPE html&gt;\n",
       "&lt;html lang=&quot;en&quot;&gt;\n",
       "    &lt;head&gt;\n",
       "        &lt;meta charset=&quot;utf-8&quot; /&gt;\n",
       "        &lt;link href=&quot;https://www.highcharts.com/highslide/highslide.css&quot; rel=&quot;stylesheet&quot; /&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/highcharts.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/highcharts-more.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/modules/exporting.js&quot;&gt;&lt;/script&gt;\n",
       "    &lt;/head&gt;\n",
       "    &lt;body style=&quot;margin:0;padding:0&quot;&gt;\n",
       "                &lt;div id=&quot;container&quot; style=&quot;width:850px;height:400px;&quot;&gt;Loading....&lt;/div&gt;\n",
       "\n",
       "\n",
       "    &lt;script&gt;\n",
       "        $(function(){\n",
       "\n",
       "\n",
       " \n",
       "\n",
       "\n",
       "\n",
       "\n",
       "            Highcharts.setOptions({&quot;lang&quot;: {}, &quot;global&quot;: {}});\n",
       "            var option = {&quot;loading&quot;: {}, &quot;subtitle&quot;: {&quot;text&quot;: &quot;Source: WorldClimate.com&quot;}, &quot;xAxis&quot;: [{&quot;crosshair&quot;: true, &quot;categories&quot;: [&quot;Jan&quot;, &quot;Feb&quot;, &quot;Mar&quot;, &quot;Apr&quot;, &quot;May&quot;, &quot;Jun&quot;, &quot;Jul&quot;, &quot;Aug&quot;, &quot;Sep&quot;, &quot;Oct&quot;, &quot;Nov&quot;, &quot;Dec&quot;]}], &quot;title&quot;: {&quot;text&quot;: &quot;Average Monthly Weather Data for Tokyo&quot;}, &quot;series&quot;: {}, &quot;labels&quot;: {}, &quot;yAxis&quot;: [{&quot;labels&quot;: {&quot;style&quot;: {&quot;color&quot;: Highcharts.getOptions().colors[2]}, &quot;format&quot;: &quot;{value}\\u00b0C&quot;}, &quot;opposite&quot;: true, &quot;title&quot;: {&quot;text&quot;: &quot;Temperature&quot;, &quot;style&quot;: {&quot;color&quot;: Highcharts.getOptions().colors[2]}}}, {&quot;title&quot;: {&quot;text&quot;: &quot;Rainfall&quot;, &quot;style&quot;: {&quot;color&quot;: Highcharts.getOptions().colors[0]}}, &quot;labels&quot;: {&quot;style&quot;: {&quot;color&quot;: Highcharts.getOptions().colors[0]}, &quot;format&quot;: &quot;{value} mm&quot;}, &quot;gridLineWidth&quot;: 0}, {&quot;title&quot;: {&quot;text&quot;: &quot;Sea-Level Pressure&quot;, &quot;style&quot;: {&quot;color&quot;: Highcharts.getOptions().colors[1]}}, &quot;labels&quot;: {&quot;style&quot;: {&quot;color&quot;: Highcharts.getOptions().colors[1]}, &quot;format&quot;: &quot;{value} mb&quot;}, &quot;opposite&quot;: true, &quot;gridLineWidth&quot;: 0}], &quot;chart&quot;: {&quot;width&quot;: 850, &quot;zoomType&quot;: &quot;xy&quot;, &quot;renderTo&quot;: &quot;container&quot;, &quot;height&quot;: 400}, &quot;tooltip&quot;: {&quot;shared&quot;: true}, &quot;plotOptions&quot;: {}, &quot;credits&quot;: {&quot;enabled&quot;: false}, &quot;colors&quot;: {}, &quot;pane&quot;: {}, &quot;exporting&quot;: {}, &quot;drilldown&quot;: {}, &quot;navigation&quot;: {}, &quot;legend&quot;: {&quot;verticalAlign&quot;: &quot;top&quot;, &quot;backgroundColor&quot;: (Highcharts.theme &amp;&amp; Highcharts.theme.legendBackgroundColor) || &#x27;#FFFFFF&#x27;, &quot;y&quot;: 55, &quot;x&quot;: 80, &quot;align&quot;: &quot;left&quot;, &quot;floating&quot;: true, &quot;layout&quot;: &quot;vertical&quot;}};\n",
       "\n",
       "\n",
       "            var data = [{&quot;name&quot;: &quot;Rainfall&quot;, &quot;yAxis&quot;: 1, &quot;type&quot;: &quot;column&quot;, &quot;data&quot;: [49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4], &quot;tooltip&quot;: {&quot;valueSuffix&quot;: &quot; mm&quot;}}, {&quot;dashStyle&quot;: &quot;shortdot&quot;, &quot;name&quot;: &quot;Sea-Level Pressure&quot;, &quot;yAxis&quot;: 2, &quot;type&quot;: &quot;spline&quot;, &quot;tooltip&quot;: {&quot;valueSuffix&quot;: &quot; mb&quot;}, &quot;marker&quot;: {&quot;enabled&quot;: false}, &quot;data&quot;: [1016, 1016, 1015.9, 1015.5, 1012.3, 1009.5, 1009.6, 1010.2, 1013.1, 1016.9, 1018.2, 1016.7]}, {&quot;data&quot;: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6], &quot;type&quot;: &quot;spline&quot;, &quot;name&quot;: &quot;Temperature&quot;, &quot;tooltip&quot;: {&quot;valueSuffix&quot;: &quot; \\u00b0C&quot;}}]\n",
       "            option.series = data;\n",
       "\n",
       " \n",
       "\n",
       "            var chart = new Highcharts.Chart(option);\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       " \n",
       "\n",
       "\n",
       "        \n",
       "    });\n",
       "        &lt;/script&gt;\n",
       "\n",
       "    &lt;/body&gt;\n",
       "&lt;/html&gt;\" height=400 width=850></iframe>"
      ],
      "text/plain": [
       "<highcharts.highcharts.highcharts.Highchart at 0x7f38681e3090>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from highcharts import Highchart\n",
    "H = Highchart(width=850, height=400)\n",
    "\n",
    "data1 = [49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]\n",
    "data2 = [1016, 1016, 1015.9, 1015.5, 1012.3, 1009.5, 1009.6, 1010.2, 1013.1, 1016.9, 1018.2, 1016.7]\n",
    "data3 = [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]\n",
    "\n",
    "options = {\n",
    "\t'chart': {\n",
    "        'zoomType': 'xy'\n",
    "    },\n",
    "    'title': {\n",
    "        'text': 'Average Monthly Weather Data for Tokyo'\n",
    "    },\n",
    "    'subtitle': {\n",
    "        'text': 'Source: WorldClimate.com'\n",
    "    },\n",
    "    'xAxis': [{\n",
    "        'categories': ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n",
    "            'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n",
    "        'crosshair': True\n",
    "    }],\n",
    "    'yAxis': [{ \n",
    "        'labels': {\n",
    "            'format': '{value}°C',\n",
    "            'style': {\n",
    "                'color': 'Highcharts.getOptions().colors[2]'\n",
    "            }\n",
    "        },\n",
    "        'title': {\n",
    "            'text': 'Temperature',\n",
    "            'style': {\n",
    "                'color': 'Highcharts.getOptions().colors[2]'\n",
    "            }\n",
    "        },\n",
    "        'opposite': True\n",
    "\n",
    "    }, { \n",
    "        'gridLineWidth': 0,\n",
    "        'title': {\n",
    "            'text': 'Rainfall',\n",
    "            'style': {\n",
    "                'color': 'Highcharts.getOptions().colors[0]'\n",
    "            }\n",
    "        },\n",
    "        'labels': {\n",
    "            'format': '{value} mm',\n",
    "            'style': {\n",
    "                'color': 'Highcharts.getOptions().colors[0]'\n",
    "            }\n",
    "        }\n",
    "\n",
    "    }, { \n",
    "        'gridLineWidth': 0,\n",
    "        'title': {\n",
    "            'text': 'Sea-Level Pressure',\n",
    "            'style': {\n",
    "                'color': 'Highcharts.getOptions().colors[1]'\n",
    "            }\n",
    "        },\n",
    "        'labels': {\n",
    "            'format': '{value} mb',\n",
    "            'style': {\n",
    "                'color': 'Highcharts.getOptions().colors[1]'\n",
    "            }\n",
    "        },\n",
    "        'opposite': True\n",
    "    }],\n",
    "    'tooltip': {\n",
    "        'shared': True,\n",
    "        \n",
    "    },\n",
    "    'legend': {\n",
    "        'layout': 'vertical',\n",
    "        'align': 'left',\n",
    "        'x': 80,\n",
    "        'verticalAlign': 'top',\n",
    "        'y': 55,\n",
    "        'floating': True,\n",
    "        'backgroundColor': \"(Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'\"\n",
    "    },\n",
    "}\n",
    "H.set_dict_options(options)\n",
    "\n",
    "H.add_data_set(data1, 'column', 'Rainfall', yAxis=1, tooltip={\n",
    "                'valueSuffix': ' mm'})\n",
    "H.add_data_set(data2, 'spline', 'Sea-Level Pressure', yAxis=2 ,marker={\n",
    "                'enabled': False\n",
    "            },\n",
    "            dashStyle='shortdot',\n",
    "            tooltip={\n",
    "                'valueSuffix': ' mb'\n",
    "            })\n",
    "H.add_data_set(data3, 'spline', 'Temperature', tooltip={\n",
    "                'valueSuffix': ' °C'\n",
    "            })\n",
    "\n",
    "H"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
